Skip to content

Allow setting os environment vars in python::gunicorn#133

Merged
stankevich merged 3 commits into
voxpupuli:masterfrom
derektamsen:20141021-add_osenv_feature
Oct 22, 2014
Merged

Allow setting os environment vars in python::gunicorn#133
stankevich merged 3 commits into
voxpupuli:masterfrom
derektamsen:20141021-add_osenv_feature

Conversation

@derektamsen
Copy link
Copy Markdown
Contributor

Adding the ability to set os environment variables for the gunicorn process. This adds the "osenv" attribute to python::gunicorn which accepts a hash of 'key': 'value' pairs. This defaults to False which keeps backwards compatibility in the vhost gunicorn config file.

For example you could set an os environment variable that allows you to set a gunicorn app's database server with:

python::gunicorn { 'vhost':
  osenv       => { 'DBHOST' => 'dbserver.example.com' },
}

Which would add the following to /etc/gunicorn.d/vhost.conf:

...
'environment': {
    'DBHOST': 'dbserver.example.com',
...

Resolves #132

stankevich added a commit that referenced this pull request Oct 22, 2014
Allow setting os environment vars in python::gunicorn
@stankevich stankevich merged commit 7299cd1 into voxpupuli:master Oct 22, 2014
@derektamsen derektamsen deleted the 20141021-add_osenv_feature branch October 30, 2014 20:45
stankevich added a commit that referenced this pull request Sep 1, 2015
Allow setting os environment vars in python::gunicorn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Gunicorn does not allow passing in a list of environment variables

2 participants